package com.monkey.core;

/**
 * desc:
 * auth: chenxiaobin
 * data: 2017/5/19.
 */
public class ErrorCode {
    public static final int SUCCESS             = 0;

    // 系统错误
    public static final int TOKEN_ERROR         = -1;
    public static final int EXCEPTION_ERROR     = -2;
    public static final int SERVICE_DISABLE     = -3;
    public static final int ACCOUNT_DISABLE     = -4;

    // 通用错误
    public static final int PARAM_ERROR         = -1001;
    public static final int GET_DATA_ERROR      = -1002;
    public static final int WRITE_DB_ERROR      = -1003;

    // 账号错误
    public static final int INIT_NEW_ERROR      = -2001;
    public static final int USER_HAS_EXIST      = -2002;
    public static final int USER_NO_EXIST       = -2003;
    public static final int PASSWORD_ERROR      = -2004;
    public static final int PWD_NO_EQUAL        = -2005;
    public static final int MODIFY_CODE_ERROR   = -2006;
    public static final int WALLET_NO_BIND      = -2007;
    public static final int WALLET_LESS_ERROR   = -2008;
    public static final int MODIFY_TIME_ERROR   = -2009;
    public static final int MODIFY_CODE_TIMEOUT = -2010;
    public static final int SMS_ERROR           = -2011;
    public static final int WALLET_SIZE_ERROR   = -2012;
    public static final int WALLET_HAS_EXIST    = -2013;

    // 宠物错误
    public static final int CREATE_MONKEY_ERROR = -3001;
    public static final int MONKEY_STATUS_ERROR = -3002;
    public static final int NO_OWNER_MONKEY     = -3003;
    public static final int YOUR_MONKEY_ERROR   = -3004;
    public static final int FEED_COUNT_ERROR    = -3005;
    public static final int REPRODUCT_CD_ERROR  = -3006;
    public static final int FEED_PRICE_ERROR    = -3007;
    public static final int MONKEY_HAS_ONLY     = -3008;
    public static final int MONKEY_LESS_WEIGHT  = -3009;
   
    // 订单错误
    public static final int ORDER_HAS_EXIST     = -4001;
    public static final int ORDER_PRICE_ERROR   = -4002;
    public static final int ORDER_LESS_ZERO     = -4003;

    // 提现错误
    public static final int DRAW_HAS_EXIST      = -5001;
    public static final int DRAW_NO_EXIST       = -5002;

    // 发送奖励
    public static final int REWARD_MONKEY_FAIL  = -6001;
    public static final int REWARD_GOLD_FAIL    = -6002;

    // 抽奖
    public static final int LUCK_ERROR          = -7001;
    public static final int LUCK_HAS_EXIST      = -7002;
    
    // 宠物合成
    public static final int SYNTHESISE_ELEMENT_ERROR	= -8001;
    public static final int SYNTHESISE_GOLD_LESS_ERROR	= -8002;

    public static String getMsg(int code) {
        switch (code) {
            case SUCCESS:
                return "成功";

            // 系统错误
            case TOKEN_ERROR:
                return "会话超时";
            case EXCEPTION_ERROR:
                return "网络异常";
            case SERVICE_DISABLE:
                return "服务器未开放";
            case ACCOUNT_DISABLE:
                return "账号未激活，请激活账号";

            // 通用错误
            case PARAM_ERROR:
                return "参数不足";
            case GET_DATA_ERROR:
                return "获取数据失败";
            case WRITE_DB_ERROR:
                return "写入数据库失败";

            // 账号错误
            case INIT_NEW_ERROR:
                return "初始化新用户异常";
            case USER_HAS_EXIST:
                return "用户已经存在";
            case USER_NO_EXIST:
                return "用户不存在";
            case PASSWORD_ERROR:
                return "账号或密码错误";
            case PWD_NO_EQUAL:
                return "原始密码错误";
            case MODIFY_CODE_ERROR:
                return "无效验证码";
            case WALLET_NO_BIND:
                return "没有绑定钱包";
            case WALLET_LESS_ERROR:
                return "钱包余额不足";
            case MODIFY_TIME_ERROR:
                return "获取验证码的间隔必须大于1分钟";
            case MODIFY_CODE_TIMEOUT:
                return "验证码已过期";
            case SMS_ERROR:
                return "短信发送失败";
            case WALLET_SIZE_ERROR:
                return "钱包格式错误";
            case WALLET_HAS_EXIST:
                return "其他账号已经绑定过该钱包";

            // 宠物错误
            case CREATE_MONKEY_ERROR:
                return "生育新宠物失败";
            case MONKEY_STATUS_ERROR:
                return "宠物不在正常状态";
            case NO_OWNER_MONKEY:
                return "宠物不属于你";
            case YOUR_MONKEY_ERROR:
                return "不能对自己的宠物下单";
            case FEED_COUNT_ERROR:
                return "喂食次数超出上限";
            case REPRODUCT_CD_ERROR:
                return "还没到下次生育时间";
            case FEED_PRICE_ERROR:
                return "喂食金额只能在1-10之间";
            case MONKEY_HAS_ONLY:
                return "宠物不能同时出售和生育";
            case MONKEY_LESS_WEIGHT:
                return "宠物体重大于40kg才能进行生育";

            // 订单错误
            case ORDER_HAS_EXIST:
                return "订单已经存在";
            case ORDER_PRICE_ERROR:
                return "订单价格已经被修改";

            // 提现错误
            case DRAW_HAS_EXIST:
                return "已经存在一个提现请求";
            case DRAW_NO_EXIST:
                return "没有提现请求";

            // 发送奖励
            case REWARD_MONKEY_FAIL:
                return "发送奖励宠物失败";
            case REWARD_GOLD_FAIL:
                return "发送奖励金币失败";

            // 抽奖
            case LUCK_ERROR:
                return "抽奖失败";
            case LUCK_HAS_EXIST:
                return "每天只能抽奖一次";

            // 宠物合成
            case SYNTHESISE_ELEMENT_ERROR:
            	return "合成所需五行不齐全";
            case SYNTHESISE_GOLD_LESS_ERROR:
            	return "狗头金不足";
                
            default:
                return "未知错误";
        }
    }
}
